package com.baizhiedu.basic;

/**
 * 功能：
 * 作者：HZj
 * 日期：2024/12/16 21:28
 */
public class UserServiceImpl implements UserService{
//    private UserDAO userDAO = new UserDAOImpl();

//    private UserDAO userDAO = BeanFactory.getUserDAO();
//    private UserDAO userDAO = (UserDAO)BeanFactory.getBean("userDAO");
    private UserDAO userDAO;

    public UserDAO getUserDAO() {
        return userDAO;
    }

    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }

    @Override
    public void register(User user) {
        userDAO.save(user);
    }

    @Override
    public void login(String name, String password) {
        userDAO.queryUserByNameAndPassword(name,password);
    }
}
